import 'package:flutter/material.dart';
import 'package:flutterapp/widgets/TravelPacking.dart';

class CustomListItem extends StatelessWidget {
  CustomListItem({
    Key key,
    this.thumbnail,
    this.title,
    this.subtitle,
    this.author,
    this.publishDate,
    this.readDuration,
  }) : super(key: key);

  final Widget thumbnail;
  final String title;
  final String subtitle;
  final String author;
  final String publishDate;
  final String readDuration;

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.symmetric(vertical: 10.0),
      child: Card(
          elevation: 20.0,
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.all(Radius.circular(10.0)),
          ),
          clipBehavior: Clip.antiAlias,
          semanticContainer: false,
          child: SizedBox(
            height: 150,
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: <Widget>[
                Container(child: thumbnail),
                Expanded(
                  child: Padding(
                    padding: const EdgeInsets.fromLTRB(20.0, 0.0, 2.0, 0.0),
                    child: TravelPacking(
                      title: title,
                      subtitle: subtitle,
                      author: author,
                      publishDate: publishDate,
                      readDuration: readDuration,
                    ),
                  ),
                )
              ],
            ),
          )),
    );
  }
}
